<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>充值</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/jiazai.css">
    <style>
        .tit-wrap {
            position: fixed;
            top: 10px;
            right: 0;
            left: 0;
            padding: 0 20px;
            font-size: 16px;
            color: white;
        }
        
        .content {
            position: fixed;
            top: 50px;
            right: 0;
            left: 0;
            bottom: 0;
            padding: 0 20px;
            overflow: auto;
        }
        
        .phone,
        .edit-pas {
            padding: 20px 0;
            color: #9197AE;
            font-size: 14px;
            border-bottom: 1px solid #32343e;
        }
        
        .des-btn {
            position: fixed;
            right: 0;
            left: 0;
            bottom: 40px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .des-btn>p {
            width: 80%;
            padding: 15px 0;
            border-radius: 50px;
            font-size: 15px;
            text-align: center;
            color: white;
            background: #2590FE;
        }
    </style>
</head>

<body style="background:#2a2c35;">
    <div id='app'>


        <!-- 加载中动画 -->
        <div id='jiazai-ani' v-if='jiazai'>
            <div class="arc"></div>
            <h1><span>LOADING</span></h1>
        </div>
        <!-- 加载中动画 -->

        <div class='tit-wrap dis-spa'>
            <img @click='_close()' src="./img/left.svg" width="22px">
            <div>
                <span>我的账号</span>
            </div>
            <span style="opacity:0;">1</span>
        </div>

        <div class='content'>
            <div class='dis-spa phone'>
                <span>手机号</span>
                <span v-text="phone()" style="color:rgba(255,255,255,.8);">15415</span>
            </div>
            <div class='dis-spa phone'>
                <span>用户名</span>
                <span v-text="nickname" style="color:rgba(255,255,255,.8);">15415</span>
            </div>
            <div class='dis-spa edit-pas'>
                <div>
                    密码
                </div>
                <div class='dis-spa' @click="_openHref({url:'edit-password.html',id:'editPassword'})">
                    <span style="margin-right:10px;">修改密码</span>
                    <img src="./img/right.svg" width="16px" height="16px">
                </div>
            </div>
        </div>
        <div class='des-btn'>
            <p @click='des'>退出登陆</p>
        </div>
    </div>
    <script src="js/comm.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/jquery.min.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                jiazai: false,
                nickname: JSON.parse(localStorage.getItem('cc_user')).nickname
            },
            methods: {
                phone: function() {
                    var phone = JSON.parse(localStorage.getItem('cc_user')).phone;
                    return phone.slice(0, 4) + '****' + phone.slice(8, 11);
                },
                //退出登陆
                des: function() {
                    var This = this;
                    plus.nativeUI.confirm("确定退出登陆吗?", function(e) {
                        if (!e.index) {
                            var login = plus.webview.getWebviewById('login') || plus.webview.getLaunchWebview();
                            if (login) {
                                login.close('none');
                            }
                            localStorage.setItem('cc_user', '');
                            This.jiazai = true;
                            setTimeout(function() {
                                _openHref({
                                    url: 'login.html',
                                    id: 'login'
                                });
                            }, 1000);
                        }
                    });
                }
            }
        });
    </script>
</body>

</html>